<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0054)http://technoplaza.suso.org/assembly/index.cgi?p=68ks1 -->
<HTML><HEAD><TITLE>Effective Addressing</TITLE>
<META content="text/html; charset=windows-1252" http-equiv=Content-Type>
<META content="MSHTML 5.00.2314.1000" name=GENERATOR>
<link href="edit68k.css" rel="stylesheet" type="text/css">
</HEAD>
<BODY bgColor=#ffffff>
<H1 class="heading">Effective Addressing<br>
    <hr noshade>
</H1>
<P align=left><span class="text">The 68000 has 14 different ways to address things in the memory. This example will use the instruction MOVE (LD on Z80, MOV on x86) to demonstrate how they work. Later, in the instruction summary, you'll see that when an instruction has &lt;ea&gt; (effective address) as an argument, it doesn't mean it can use all 14 ways to address. It almost always has restrictions.</span></P>
<OL>
  <LI>
    <P align=left><span class="text"><b>DATA REGISTER DIRECT</b><BR>
          <BR>
      Syntax: Dn (where n is 0-7)<BR>
                <BR>
      Example: MOVE.L D1,D0 copies the contents of D1 to D0. When the instruction is executed, both registers will contain the same information. When moving a byte or a word, the upper part of the register will remain unchanged.</span></P>
  </LI>
</OL>
<BLOCKQUOTE>
  <TABLE border=2 cellSpacing=0 width="90%">
    <TBODY>
      <TR>
        <TD align=middle width="33%"><FONT 
                color=#000080><STRONG>Instruction</STRONG></FONT></TD>
        <TD align=middle width="33%"><FONT 
                color=#000080><STRONG>Before</STRONG></FONT></TD>
        <TD align=middle width="34%"><FONT 
                color=#000080><STRONG>After</STRONG></FONT></TD>
      </TR>
      <TR>
        <TD align=middle rowSpan=2 width="33%"><STRONG>MOVE.B D1,D0</STRONG></TD>
        <TD width="33%"><P align=center><STRONG>D0=FFFFFFFF</STRONG></P></TD>
        <TD width="34%"><P align=center><STRONG>D0=FFFFFF67</STRONG></P></TD>
      </TR>
      <TR>
        <TD width="33%"><P align=center><STRONG>D1=01234567</STRONG></P></TD>
        <TD width="34%"><P align=center><STRONG>D1=01234567</STRONG></P></TD>
      </TR>
      <TR>
        <TD align=middle rowSpan=2 width="33%"><STRONG>MOVE.W D1,D0</STRONG></TD>
        <TD width="33%"><P align=center><STRONG>D0=FFFFFFFF</STRONG></P></TD>
        <TD width="34%"><P align=center><STRONG>D0=FFFF4567</STRONG></P></TD>
      </TR>
      <TR>
        <TD width="33%"><P align=center><STRONG>D1=01234567</STRONG></P></TD>
        <TD width="34%"><P 
          align=center><STRONG>D1=01234567</STRONG></P></TD>
      </TR>
    </TBODY>
  </TABLE>
	<p align="center">&nbsp;</p>
</BLOCKQUOTE>
<OL start=3>
  <LI type=disc>
    <P align=left class="text"><b>ADDRESS REGISTER DIRECT</b><BR>
                <BR>
                Syntax: An (n is 0-7)<BR>
                <BR>
                Example: MOVE.L A1,D0 copies all of A1 to D0. After the instruction, both registers contain the same information. When transferring address registers, you must use word or longword. When a word is transferred TO an address register, bit 15 (the sign bit) will be copied trough the whole upper word (bit 16-31). If it wasn't so, a negative number would become positive.</P>
    <TABLE border=2 cellSpacing=0 width="90%">
      <TBODY>
        <TR>
          <TD align=middle width="40%"><FONT 
                color=#000080><STRONG>Instruction</STRONG></FONT></TD>
          <TD align=middle width="30%"><FONT 
                color=#000080><STRONG>Before</STRONG></FONT></TD>
          <TD align=middle width="30%"><FONT 
                color=#000080><STRONG>After</STRONG></FONT></TD>
        </TR>
        <TR>
          <TD align=middle rowSpan=2 width="40%"><STRONG>MOVE.W A1,D0</STRONG></TD>
          <TD align=middle width="30%"><STRONG>D0=FFFFFFFF</STRONG></TD>
          <TD align=middle width="30%"><STRONG>D0=FFFF4567</STRONG></TD>
        </TR>
        <TR>
          <TD align=middle width="30%"><STRONG>A1=01234567</STRONG></TD>
          <TD align=middle width="30%"><STRONG>A1=01234567</STRONG></TD>
        </TR>
        <TR>
          <TD align=middle rowSpan=2 width="40%"><STRONG>MOVE.W D0,A1</STRONG></TD>
          <TD align=middle width="31%"><STRONG>D0=01234567</STRONG></TD>
          <TD align=middle width="29%"><STRONG>D0=01234567</STRONG></TD>
        </TR>
        <TR>
          <TD align=middle width="31%"><STRONG>A1=FFFFFFFF</STRONG></TD>
          <TD align=middle width="29%"><STRONG>A1=00004567</STRONG></TD>
        </TR>
        <TR>
          <TD align=middle rowSpan=2 width="40%"><STRONG>MOVE.W D0,A1</STRONG></TD>
          <TD align=middle width="31%"><STRONG>D0=0000FFFF</STRONG></TD>
          <TD align=middle width="29%"><STRONG>D0=0000FFFF</STRONG></TD>
        </TR>
        <TR>
          <TD align=middle width="31%"><STRONG>A1=00000000</STRONG></TD>
          <TD align=middle 
            width="29%"><STRONG>A1=FFFFFFFF</STRONG></TD>
        </TR>
      </TBODY>
    </TABLE>
    <p>
    <br>
  <LI type=disc value=3>
    <P align=left class="text"><b>ADDRESS REGISTER INDIRECT</b><BR>
                <BR>
                Syntax: (An) (n is 0-7)<BR>
                <BR>
                Example: MOVE.L (A0),D0 copies the longword stored at address location A0 (you say A0 points to the longword). If you refer to a word or a longword, the address in the address register must be an even number. THIS CAN CAUSE BIG PROBLEMS AND UNEXPECTED ERRORS!</P>
    <TABLE border=2 cellSpacing=0 width="90%">
      <TBODY>
        <TR>
          <TD align=middle width="40%"><FONT 
                color=#000080><STRONG>Instruction</STRONG></FONT></TD>
          <TD align=middle width="30%"><FONT 
                color=#000080><STRONG>Before</STRONG></FONT></TD>
          <TD align=middle width="30%"><FONT 
                color=#000080><STRONG>After</STRONG></FONT></TD>
        </TR>
        <TR>
          <TD align=middle rowSpan=3 width="33%"><STRONG>MOVE.L (A1),D0</STRONG></TD>
          <TD align=middle width="33%"><STRONG>D0=FFFFFFFF</STRONG></TD>
          <TD align=middle width="34%"><STRONG>D0=01234567</STRONG></TD>
        </TR>
        <TR>
          <TD align=middle width="33%"><STRONG>A1=00001000</STRONG></TD>
          <TD align=middle width="34%"><STRONG>A1=00001000</STRONG></TD>
        </TR>
        <TR>
          <TD align=middle width="33%"><STRONG>$1000=01234567</STRONG></TD>
          <TD align=middle 
            width="34%"><STRONG>$1000=01234567</STRONG></TD>
        </TR>
      </TBODY>
    </TABLE>
    <br>
    <br>
  <LI type=disc value=4>
    <P align=left class="text"><b>ADDRESS REGISTER INDIRECT WITH POST-INCREMENT</b><BR>
                <BR>
                Syntax: (An)+ (n is 0-7)<BR>
                <BR>
                Description.: Works the same as the previous addressing mode, except that after the instruction, register An will be increased with the size of the operation. A special case is when you use A7 and transfer a byte, because A7 will be increased with 2 instead of 1, because A7, as the stack pointer, must be an even number.<BR>
                <BR>
                Example: MOVE.L (A1)+,D0 copies the longword which A1 points to to D0, and increases A1 by 4 bytes.</P>
    <TABLE border=2 cellSpacing=0 width="90%">
      <TBODY>
        <TR>
          <TD align=middle width="40%"><FONT 
                color=#000080><STRONG>Instruction</STRONG></FONT></TD>
          <TD align=middle width="30%"><FONT 
                color=#000080><STRONG>Before</STRONG></FONT></TD>
          <TD align=middle width="30%"><FONT 
                color=#000080><STRONG>After</STRONG></FONT></TD>
        </TR>
        <TR>
          <TD align=middle rowSpan=3 width="33%"><STRONG>MOVE.L (A1)+,D0 </STRONG></TD>
          <TD align=middle width="33%"><STRONG>D0=FFFFFFFF</STRONG></TD>
          <TD align=middle width="34%"><STRONG>D0=01234567</STRONG></TD>
        </TR>
        <TR>
          <TD align=middle width="33%"><STRONG>A1=00001000</STRONG></TD>
          <TD align=middle width="34%"><STRONG>A1=00001004</STRONG></TD>
        </TR>
        <TR>
          <TD align=middle width="33%"><STRONG>$1000=01234567</STRONG></TD>
          <TD align=middle 
            width="34%"><STRONG>$1000=01234567</STRONG></TD>
        </TR>
      </TBODY>
    </TABLE>
    <br>
    <br>
  <LI type=disc value=5>
    <P align=left class="text"><b>ADDRESS REGISTER INDIRECT WITH PRE-DECREMENT</b><BR>
                <BR>
                Syntax: -(An) (n is 0-7)<BR>
                <BR>
                Description.: Works the same as the previous addressing mode, except that register An will first be decreased with the operand size (with the exception of A7), then the data will be transferred. Example: MOVE.L -(A1),D0 first decreases A1 by 4 bytes, then copies the longword stored at A1 to D0.</P>
    <TABLE border=2 cellSpacing=0 width="90%">
      <TBODY>
        <TR>
          <TD align=middle width="40%"><FONT 
                color=#000080><STRONG>Instruction</STRONG></FONT></TD>
          <TD align=middle width="30%"><FONT 
                color=#000080><STRONG>Before</STRONG></FONT></TD>
          <TD align=middle width="30%"><FONT 
                color=#000080><STRONG>After</STRONG></FONT></TD>
        </TR>
        <TR>
          <TD align=middle rowSpan=3 width="33%"><STRONG>MOVE.L -(A1),D0</STRONG></TD>
          <TD align=middle width="33%"><STRONG>D0=FFFFFFFF</STRONG></TD>
          <TD align=middle width="34%"><STRONG>D0=01234567</STRONG></TD>
        </TR>
        <TR>
          <TD align=middle width="33%"><STRONG>A1=00001004</STRONG></TD>
          <TD align=middle width="34%"><STRONG>A1=00001000</STRONG></TD>
        </TR>
        <TR>
          <TD align=middle width="33%"><STRONG>$1000=01234567</STRONG></TD>
          <TD align=middle 
            width="34%"><STRONG>$1000=01234567</STRONG></TD>
        </TR>
      </TBODY>
    </TABLE>
    <br>
    <br>
  <LI type=disc value=6>
    <P align=left class="text"><b>ADDRESS REGISTER INDIRECT WITH DISPLACEMENT</b><BR>
                <BR>
                Syntax: x(An) (x is 16 bit, n is 0-7)<BR>
                <BR>
                Description: The location pointed at x+An is the one that will be copied.<BR>
                <BR>
                Example: MOVE.L 4(A1),D0 copies the longword stored at A1+4 to D0. A1 will, after the instruction, remain unchanged. Note that if x is bigger than $7FFF, it means a negative value. It's because of the sign extension.</P>
    <TABLE border=2 cellSpacing=0 width="90%">
      <TBODY>
        <TR>
          <TD align=middle width="40%"><FONT 
                color=#000080><STRONG>Instruction</STRONG></FONT></TD>
          <TD align=middle width="30%"><FONT 
                color=#000080><STRONG>Before</STRONG></FONT></TD>
          <TD align=middle width="30%"><FONT 
                color=#000080><STRONG>After</STRONG></FONT></TD>
        </TR>
        <TR>
          <TD align=middle rowSpan=3 width="33%"><STRONG>MOVE.L 4(A1),D0</STRONG></TD>
          <TD align=middle width="33%"><STRONG>D0=FFFFFFFF</STRONG></TD>
          <TD align=middle width="34%"><STRONG>D0=01234567</STRONG></TD>
        </TR>
        <TR>
          <TD align=middle width="33%"><STRONG>A1=00001000</STRONG></TD>
          <TD align=middle width="34%"><STRONG>A1=00001000</STRONG></TD>
        </TR>
        <TR>
          <TD align=middle width="33%"><STRONG>$1004=01234567</STRONG></TD>
          <TD align=middle 
            width="34%"><STRONG>$1004=01234567</STRONG></TD>
        </TR>
      </TBODY>
    </TABLE>
    <br>
    <br>
  <LI type=disc value=7>
    <P align=left class="text"><b>ADDRESS REGISTER INDIRECT WITH INDEX</b><BR>
                <BR>
                Syntax: x(An,Dn.L) (x is an 8 bit signed constant, n is 0-7)<BR>
                x(An,Dn.W)<BR>
                x(An,An.W)<BR>
                x(An,An.L)<BR>
                <BR>
                Description.: Works the same as the previous addressing mode, except that another register also will be added (if it's a word, a sign extension will be made before, so it will be a subtraction). When working with words or longwords, the generated address must be an even address.<BR>
                <BR>
                Example: MOVE.L 4(A1,A2.L),D0 copies the longword stored at A1+A2+4 to D0. A1 and A2 will after the instruction remain unchanged. Note that if x is bigger than $7F, it means a negative value. It's because of the sign extension.</P>
    <TABLE border=2 cellSpacing=0 width="90%">
      <TBODY>
        <TR>
          <TD align=middle width="40%"><FONT 
                color=#000080><STRONG>Instruction</STRONG></FONT></TD>
          <TD align=middle width="30%"><FONT 
                color=#000080><STRONG>Before</STRONG></FONT></TD>
          <TD align=middle width="30%"><FONT 
                color=#000080><STRONG>After</STRONG></FONT></TD>
        </TR>
        <TR>
          <TD align=middle rowSpan=4 width="33%"><STRONG>MOVE.L 4(A1,A2.L),D0</STRONG></TD>
          <TD align=middle width="33%"><STRONG>D0=FFFFFFFF</STRONG></TD>
          <TD align=middle width="34%"><STRONG>D0=01234567</STRONG></TD>
        </TR>
        <TR>
          <TD align=middle width="33%"><STRONG>A1=00001000</STRONG></TD>
          <TD align=middle width="34%"><STRONG>A1=00001000</STRONG></TD>
        </TR>
        <TR>
          <TD align=middle width="33%"><STRONG>A2=00001000</STRONG></TD>
          <TD align=middle width="34%"><STRONG>A2=00001000</STRONG></TD>
        </TR>
        <TR>
          <TD align=middle width="33%"><STRONG>$2004=01234567</STRONG></TD>
          <TD align=middle 
            width="34%"><STRONG>$2004=01234567</STRONG></TD>
        </TR>
      </TBODY>
    </TABLE>
    <br>
    <br>
  <LI type=disc>
    <P align=left class="text"><b>ABSOLUTE SHORT ADDRESS</b><BR>
        <BR>
        Syntax: x (x is a 16 bit signed constant)<BR>
                <BR>
                Description: The address will be sign extended before it's used, but the MSB is ignored (don't bother about that). The sign extension means that near addressing can only be used on the first 32Kb.<BR>
                <BR>
                Example: MOVE.L $1000,D0 copies the longword stored at $1000 to D0. Note that there is no parentheses! If you mean an immediate value, you put a # before the value (see below). However, adding the parentheses is not a bad idea: the assembler will accept it and it will add in readability to the source.</P>
    <TABLE border=2 cellSpacing=0 width="90%">
      <TBODY>
        <TR>
          <TD align=middle width="40%"><FONT 
                color=#000080><STRONG>Instruction</STRONG></FONT></TD>
          <TD align=middle width="30%"><FONT 
                color=#000080><STRONG>Before</STRONG></FONT></TD>
          <TD align=middle width="30%"><FONT 
                color=#000080><STRONG>After</STRONG></FONT></TD>
        </TR>
        <TR>
          <TD align=middle rowSpan=2 width="33%"><STRONG>MOVE.L $1000,D0</STRONG></TD>
          <TD align=middle width="33%"><STRONG>D0=FFFFFFFF</STRONG></TD>
          <TD align=middle width="34%"><STRONG>D0=01234567</STRONG></TD>
        </TR>
        <TR>
          <TD align=middle width="33%"><STRONG>$1000=01234567</STRONG></TD>
          <TD align=middle 
            width="34%"><STRONG>$1000=01234567</STRONG></TD>
        </TR>
      </TBODY>
    </TABLE>
    <p align="left" class="text"><b><a name="shortAddressing"></a>Forcing Absolute Short Addressing:</b> In 
	EASy68K if an instruction such as: MOVE.L $8000,D0 is assembled the 
	assembler will automatically use absolute long addressing and encode the 
	address as $00008000. It is possible to force the assembler to use absolute 
	short addressing by using .W as: MOVE.L $8000.W,D0. Forcing short addressing<font face="Arial"> 
	will always result in a Warning message &quot;Forcing SHORT addressing disables 
	range checking of extension word&quot;.</font></p>
    <TABLE border=2 cellSpacing=0 width="90%" id="table1">
      <TBODY>
        <TR>
          <TD align=middle width="40%"><FONT 
                color=#000080><STRONG>Instruction</STRONG></FONT></TD>
          <TD align=middle width="30%"><FONT 
                color=#000080><STRONG>Before</STRONG></FONT></TD>
          <TD align=middle width="30%"><FONT 
                color=#000080><STRONG>After</STRONG></FONT></TD>
        </TR>
        <TR>
          <TD align=middle rowSpan=2 width="33%"><STRONG>MOVE.L $8000,D0</STRONG></TD>
          <TD align=middle width="33%"><STRONG>D0=FFFFFFFF</STRONG></TD>
          <TD align=middle width="34%"><STRONG>D0=01234567</STRONG></TD>
        </TR>
        <TR>
          <TD align=middle width="33%"><STRONG>$00008000=01234567</STRONG></TD>
          <TD align=middle width="34%"><STRONG>$00008000=01234567</STRONG></TD>
        </TR>
        <TR>
          <TD align=middle rowSpan=2 width="33%"><STRONG>MOVE.L $8000.W,D0</STRONG></TD>
          <TD align=middle width="33%"><STRONG>D0=FFFFFFFF</STRONG></TD>
          <TD align=middle width="34%"><STRONG>D0=87654321</STRONG></TD>
        </TR>
        <TR>
          <TD align=middle width="33%"><STRONG>$00FF8000=87654321</STRONG></TD>
          <TD align=middle 
            width="34%"><STRONG>$00FF8000=87654321</STRONG></TD>
        </TR>
      </TBODY>
    </TABLE>
    <p align="left" class="text">
    <br>
  <LI type=disc>
    <P align=left class="text"><b>ABSOLUTE LONG ADDRESS</b><BR>
        <BR>
        Syntax: x (x is a 32 bit constant)<BR>
                <BR>
                Description: Works EXACTLY as the last one, except that x is a 32 bit value (the instruction is two bytes longer also).<BR>
                <BR>
                Example: MOVE.L $10000,D0 copies the longword stored at $10000 to D0.</P>
    <TABLE border=2 cellSpacing=0 width="90%">
      <TBODY>
        <TR>
          <TD align=middle width="40%"><FONT 
                color=#000080><STRONG>Instruction</STRONG></FONT></TD>
          <TD align=middle width="30%"><FONT 
                color=#000080><STRONG>Before</STRONG></FONT></TD>
          <TD align=middle width="30%"><FONT 
                color=#000080><STRONG>After</STRONG></FONT></TD>
        </TR>
        <TR>
          <TD align=middle rowSpan=2 width="33%"><STRONG>MOVE.L $10000,D0</STRONG></TD>
          <TD align=middle width="33%"><STRONG>D0=FFFFFFFF</STRONG></TD>
          <TD align=middle width="34%"><STRONG>D0=01234567</STRONG></TD>
        </TR>
        <TR>
          <TD align=middle width="34%"><STRONG>$10000=01234567</STRONG></TD>
          <TD align=middle 
            width="33%"><STRONG>$10000=01234567</STRONG></TD>
        </TR>
      </TBODY>
    </TABLE>
    <p align="left" class="text"><b>Forcing Absolute Long Addressing:</b> In 
	EASy68K if an instruction such as: MOVE.L $1000,D0 is assembled the 
	assembler will automatically use absolute short addressing and encode the 
	address as $1000. It is possible to force the assembler to use absolute long 
	addressing by using .L as: MOVE.L $1000.L,D0. </p>
    <TABLE border=2 cellSpacing=0 width="75%" id="table2">
      <TBODY>
        <TR>
          <TD align=middle width="40%"><FONT 
                color=#000080><STRONG>Instruction</STRONG></FONT></TD>
          <TD align=middle width="38%"><strong><font color="#000080">Code</font></strong></TD>
        </TR>
        <TR>
          <TD align=middle width="33%"><STRONG>MOVE.L $1000,D0</STRONG></TD>
          <TD align=middle width="38%"><strong>2038 1000</strong></TD>
        </TR>
        <TR>
          <TD align=middle width="33%"><STRONG>MOVE.L $1000.L,D0</STRONG></TD>
          <TD align=middle width="38%"><strong>2039 00001000</strong></TD>
        </TR>
      </TBODY>
    </TABLE>
    <p align="left" class="text">
    <br>
  <LI type=disc value=10>
    <P align=left class="text"><b>PROGRAM COUNTER WITH DISPLACEMENT</b><BR>
        <BR>
        Syntax: x(PC) or (x,PC) (x is a 16 bit signed constant)<BR>
                <BR>
                Description: The displacement word (x) is specified as an 
	address relative to the current PC. The assembler calculates the relative 
	offset to the displacement address and adds the resulting number to the 
	program counter to determine the address. The displacement is a signed 
	number (meaning that the limits are -32768 to +32767). This addressing mode 
	may be used to write programs that are position independent. Position 
	independent programs and their local data may be moved to any area of memory 
	and will run correctly. This is possible if all references to local data are 
	made with PC relative addressing.<BR>
                <BR>
                Example: MOVE.L $1102(PC),D0 copies the longword stored at 
	PC+$102 to D0 assuming the current PC is $1000. </P>
    <TABLE border=2 cellSpacing=0 width="90%">
      <TBODY>
        <TR>
          <TD align=middle width="40%"><FONT 
                color=#000080><STRONG>Instruction</STRONG></FONT></TD>
          <TD align=middle width="30%"><FONT 
                color=#000080><STRONG>Before</STRONG></FONT></TD>
          <TD align=middle width="30%"><FONT 
                color=#000080><STRONG>After</STRONG></FONT></TD>
        </TR>
        <TR>
          <TD align=middle rowSpan=2 width="33%"><STRONG>MOVE.L $1102(PC),D0</STRONG>
              <P><STRONG>assuming PC=$1000</STRONG></P></TD>
          <TD align=middle width="33%"><STRONG>D0=FFFFFFFF</STRONG></TD>
          <TD align=middle width="34%"><STRONG>D0=01234567</STRONG></TD>
        </TR>
        <TR>
          <TD align=middle width="33%"><STRONG>$1102=01234567</STRONG></TD>
          <TD align=middle 
            width="34%"><STRONG>$1102=01234567</STRONG></TD>
        </TR>
      </TBODY>
    </TABLE>
    <br>
    <br>
  <LI type=disc value=11>
    <P align=left class="text"><b>PROGRAM COUNTER WITH INDEX</b><BR>
        <BR>
        Syntax: x(PC,Dn.L) or (x,PC,Dn.L) (x is an 8 bit signed constant, n is 0-7)<BR>
                x(PC,Dn.W) or (x,PC,Dn.W)<BR>
                x(PC,An.W) or (x,PC,An.W)<BR>
                x(PC,An.L)&nbsp; or (x,PC,An.L)<BR>
                <BR>
                Description: The displacement byte (x) is specified as an 
	address relative to the current PC. The assembler calculates the relative 
	offset to the displacement address and adds the resulting number the program 
	counter and the sign extended index register to determine the address. The 
	displacement is a signed number (meaning that the limits are -128 to +127). 
	This addressing mode may be used to write programs that are position 
	independent. Position independent programs and their local data may be moved 
	to any area of memory and will run correctly. This is possible if all 
	references to local data are made with PC relative addressing.<BR>
                <BR>
                Example: MOVE.L $1010(PC,A1.L),D0 copies the longword stored at 
	PC+A1+$10 to D0 assuming the current PC is $1000.</P>
    <TABLE border=2 cellSpacing=0 width="90%">
      <TBODY>
        <TR>
          <TD align=middle width="40%"><FONT 
                color=#000080><STRONG>Instruction</STRONG></FONT></TD>
          <TD align=middle width="30%"><FONT 
                color=#000080><STRONG>Before</STRONG></FONT></TD>
          <TD align=middle width="30%"><FONT 
                color=#000080><STRONG>After</STRONG></FONT></TD>
        </TR>
        <TR>
          <TD align=middle rowSpan=3 width="33%"><STRONG>MOVE.L $1010(PC,A1.L),D0</STRONG>
              <P><STRONG>assuming PC=$1000</STRONG></P></TD>
          <TD align=middle width="33%"><STRONG>D0=FFFFFFFF</STRONG></TD>
          <TD align=middle width="34%"><STRONG>D0=01234567</STRONG></TD>
        </TR>
        <TR>
          <TD align=middle width="33%"><STRONG>$2010=01234567</STRONG></TD>
          <TD align=middle 
            width="34%"><STRONG>$2010=01234567</STRONG></TD>
        </TR>
        <TR>
          <TD align=middle width="33%"><STRONG>A1=00001000</STRONG></TD>
          <TD align=middle 
            width="34%"><STRONG>A1=00001000</STRONG></TD>
        </TR>
      </TBODY>
    </TABLE>
    <br>
    <br>
  <LI type=disc value=12>
    <P align=left class="text"><b>IMMEDIATE DATA</b><BR>
        <BR>
        Syntax: #x (x is 8, 16 or 32 bits)<BR>
                <BR>
                Description: Uses the immediate value x.<BR>
                <BR>
                Example: MOVE.L #$10002000,D0 copies $10002000 to D0. Note that if you copy a word to an address register, the word will be sign extended. </P>
    <TABLE border=2 cellSpacing=0 width="90%">
      <TBODY>
        <TR>
          <TD align=middle width="40%"><FONT 
                color=#000080><STRONG>Instruction</STRONG></FONT></TD>
          <TD align=middle width="30%"><FONT 
                color=#000080><STRONG>Before</STRONG></FONT></TD>
          <TD align=middle width="30%"><FONT 
                color=#000080><STRONG>After</STRONG></FONT></TD>
        </TR>
        <TR>
          <TD align=middle width="33%"><STRONG>MOVE.L #$10002000,D0</STRONG></TD>
          <TD align=middle width="33%"><STRONG>D0=01234567</STRONG></TD>
          <TD align=middle 
            width="34%"><STRONG>D0=10002000</STRONG></TD>
        </TR>
      </TBODY>
    </TABLE>
    <br>
    <br>
  <LI type=disc value=13>
    <P align=left class="text"><b>ADDRESSING WITH THE STATUS REGISTER<BR>
        </b>
        <BR>
        Syntax: SR<BR>
                CCR<BR>
                <BR>
                Description: The only instructions that are allowed to use this address mode are: ANDI (AND immediate), EORI (exclusive OR immediate), and ORI (OR immediate). If the length is a byte, the flag register is changed. If it's a word, both the flag register and the system byte are changed (but only if the supervisor bit is set) The assembler recognize both SR (that means both flags and system-byte) and CCR (only flag register), so you don't have to specify the length.<BR>
                <BR>
                Example: The instruction ORI #5,CCR sets both the carry flag (C) and the zero flag (Z). The other flags remains unchanged.<BR>
                Note: #5=#%00000101 </P>
    <TABLE border=2 cellSpacing=0 width="90%">
      <TBODY>
        <TR>
          <TD align=middle width="40%"><FONT 
                color=#000080><STRONG>Instruction</STRONG></FONT></TD>
          <TD align=middle width="30%"><FONT 
                color=#000080><STRONG>Before</STRONG></FONT></TD>
          <TD align=middle width="30%"><FONT 
                color=#000080><STRONG>After</STRONG></FONT></TD>
        </TR>
        <TR>
          <TD align=middle width="33%"><STRONG>ORI #5,CCR</STRONG></TD>
          <TD align=middle width="33%"><STRONG>CCR=0000</STRONG></TD>
          <TD align=middle 
            width="34%"><STRONG>CCR=0005</STRONG></TD>
        </TR>
      </TBODY>
    </TABLE>
  </LI>
</OL>
</BODY></HTML>
